
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<script src="${ctx}/resources/plugin/ajaxFileupload/jquery.form.js"></script>
<script type="text/javascript">
	function goImage(obj) {
		var url = obj.src;
		console.log("url的值为" + url);
		window.open(url);
	}
	function goodsBreakGroupHandle(flag){
		if(flag==1){
			if($("#handleOpinion").val()=='' || $("#handleOpinion").val()==null){
				$(this).alertmsg('info', '不同意请填写处理意见', {displayMode:'slide', displayPosition:'topcenter', okName:'确定', title:'提示'})
				return false;
			}
		}
		$("#handleResult").val(flag);
		$("#goodsForm").submit();
	}
</script>
<div class="bjui-pageContent" style="background: #FFF;">
	<form id="goodsForm" action="${ctx}/bus/goods/checkBreakGroup"
		class="ajaxForm" data-toggle="validate" enctype="multipart/form-data">
		<input type="hidden" name="id" id="id" value="${dataResult.id }">
		<input type="hidden" name="status" id="status" value="${dataResult.status}"> 
		<input type="hidden" name="breakGroupId" id="status" value="${breakgrouprecord.id}"> 
		<input type="hidden" name="handleResult" id="handleResult" > 
		<table class="table table-condensed table-hover">
			<tbody>
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">商户名称：</label>
						<input class="" id="merchantName" type="text" name="merchantName"
						readonly value="${dataResult.merchantName}"  /></td>
					<td><label for="name" class="control-label x90">商品名称：</label>
							<input class="" id="name" type="text" readonly value="${dataResult.startCityName}-${dataResult.endCityName }" />
					</td>
				</tr>
				
				<tr style="height: 30px;">
					<%-- <td>
						<label for="name" class="control-label x90">：</label>
						<input class="" id="name" type="text" name="phone" value="${dataResult.startCityName}-${dataResult.endCityName }" />
					</td> --%>
					<td>
						<label for="name" class="control-label x90">参团状态：</label>
						<input class="" id="goodsStatusName" type="text" readonly value="${dataResult.goodsStatusName}"  />
					</td>
				</tr>	
		
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">商品类型：</label>
						<input class="" id="goodsTypeName" type="text"  readonly
						value="${dataResult.goodsTypeName}" /></td>
					<td><label for="name" class="control-label x90">航班类型：</label>
						<input class="" id="flightType" type="text" readonly
						value="${dataResult.flightType==1?'单程':'往返'}"  /></td>
				</tr>
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">起飞国家：</label>
						<input class="" id="startCountryName" type="text"  readonly
						value="${dataResult.startCountryName}" /></td>
					<td><label for="name" class="control-label x90">降落国家：</label>
						<input class="" id="endCountryName" type="text" readonly
						value="${dataResult.endCountryName}"  /></td>
				</tr>
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">起飞城市：</label>
						<input class="" id="startCityName" type="text"  readonly
						value="${dataResult.startCityName}"  /></td>
					<td><label for="name" class="control-label x90">降落城市：</label>
						<input class="" id="endCityName" type="text" name="endCityName" readonly
						value="${dataResult.endCityName}"  /></td>
				</tr>
				<tr style="height: 30px;">
				<td><label for="name" class="control-label x90">去程起飞时间：</label>
						<input class="" id="goTakeOffTime" type="text"  readonly
						value="<fmt:formatDate value='${dataResult.goTakeOffTime}' pattern='yyyy-MM-dd HH:mm:ss'/>" /></td>
					<td>
						<label for="name" class="control-label x90">去程降落时间：</label>
						<input class="" id="goLandTime" type="text"  readonly
						value="<fmt:formatDate value='${dataResult.goLandTime}' pattern='yyyy-MM-dd HH:mm:ss'/>" />
					</td>
				</tr>
				<tr style="height: 30px;">
					<td>
						<label for="name" class="control-label x90">去程T+：</label>
						<input class="" id="goTDays" type="text" name="goTDays" readonly
						value="${dataResult.goTDays==''?'0' :dataResult.goTDays}"  />
					</td>
				</tr>
				<c:if test="${dataResult.flightType==2}">
				
					<tr style="height: 30px;">
						<td>
							<label for="name" class="control-label x90">返程起飞时间：</label>
							<input class="" id="returnTakeOffTime" type="text"  readonly
							value="<fmt:formatDate value='${dataResult.returnTakeOffTime}' pattern='yyyy-MM-dd HH:mm:ss'/>" />
						</td>
						<td>
							<label for="name" class="control-label x90">返程降落时间：</label>
							<input class="" id="returnLandTime" type="text" readonly
							value="<fmt:formatDate value='${dataResult.returnLandTime}' pattern='yyyy-MM-dd HH:mm:ss'/>" />
						</td>
					</tr>
					<tr style="height: 30px;">
						<td><label for="name" class="control-label x90">返程T+：</label>
							<input class="" id="returnTDays" type="text"  readonly
							value="${dataResult.returnTDays}"  />
						</td>
					</tr>
				</c:if>
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">是否允许改签：</label>
						<input class="" id="isTicketChange" type="text"  readonly
						value="${dataResult.isTicketChange==1 ? '否':'是'}"  />
					</td>
					<td><label for="name" class="control-label x90">订金：</label>
						<input class="" id="goodsDepositPercent" type="text" name="goodsDepositPercent" readonly
						value="${dataResult.goodsDepositPercent}"  />百分比（%）
					</td>
				</tr>
				
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">成人机票价格：</label>
						<input class="" id="adultTicketPrice" type="text" name="adultTicketPrice" readonly
						value="${dataResult.adultTicketPrice}"  />RMB</td>
					<td><label for="name" class="control-label x90">儿童机票价格：</label>
						<input class="" id="childrenTicketPrice" type="text" name="childrenTicketPrice" readonly value="${dataResult.childrenTicketPrice}"  />RMB
					</td>
				</tr>
				
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">婴儿机票价格：</label>
						<input class="" id="babyTicketPrice" type="text" name="babyTicketPrice" readonly
						value="${dataResult.babyTicketPrice}"  />RMB</td>
					<%-- <td><label for="name" class="control-label x90">儿童机票价格：</label>
						<input class="" id="legalPhone" type="text" name="legalPhone"  value="${dataResult.legalPhone}" />
					</td> --%>
				</tr>
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">满团人数：</label>
						<input class="" id="fullGroupNum" type="text" name="fullGroupNum" readonly
						value="${dataResult.fullGroupNum}" /></td>
					<td><label for="name" class="control-label x90">当前参团人数：</label>
						<input class="" id="currentInGroupNum" type="text" name="currentInGroupNum" readonly value="${dataResult.currentInGroupNum}" />
					</td>
				</tr>
				
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">最少成团人数：</label>
						<input class="" id="leastIntoGroupNum" type="text" name="leastIntoGroupNum" readonly
						value="${dataResult.leastIntoGroupNum}"  /></td>
					<td><label for="name" class="control-label x90">最少成人人数：</label>
						<input class="" id="leastAdultNumber" type="text" name="leastAdultNumber" readonly value="${dataResult.leastAdultNumber}"  />
					</td>
				</tr>
				
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">满额儿童人数：</label>
						<input class="" id="fullChildrenNum" type="text" name="fullChildrenNum"  readonly
						value="${dataResult.fullChildrenNum}"/></td>
					<td><label for="name" class="control-label x90">满额婴儿人数：</label>
						<input class="" id="fullBabyNum" type="text" name="fullBabyNum" readonly  value="${dataResult.fullBabyNum}" />
					</td>
				</tr>
				
				<tr style="height: 30px;">
					<td><label for="name" class="control-label x90">团票截止日期：</label>
						<input class="" id="endTime" type="text"  readonly
						value="<fmt:formatDate value='${dataResult.groupEndDate}' pattern='yyyy-MM-dd'/>"/></td>
					<td><label for="name" class="control-label x90">尾款截止日期：</label>
						<input class="" id="retainageEndTime" type="text" readonly value="<fmt:formatDate value='${dataResult.retainageEndTime}' pattern='yyyy-MM-dd HH:mm:ss'/>" />
					</td>
				</tr>
				
				<tr style="height: 30px;">
					<td colspan="3"><label for="name" class="control-label x90">商品录入时间：</label>
						<input class="" id="goodsInputTime" type="text"   readonly value="<fmt:formatDate value='${dataResult.recordTime}' pattern='yyyy-MM-dd HH:mm:ss'/>"  />
					</td>
				</tr>
				
				<tr style="height: 40px;">
					<td colspan="3"><label for="name" class="control-label x90">商品照片：</label>
						<img width="50px" name="imgUrl" id="imgUrl" src="${ctx }/${dataResult.photo1}" onclick="goImage(this)" />
						<img width="50px" name="imgUrl" id="imgUrl" src="${ctx }/${dataResult.photo2}" onclick="goImage(this)" />
						<img width="50px" name="imgUrl" id="imgUrl" src="${ctx }/${dataResult.photo3}" onclick="goImage(this)" />
						<img width="50px" name="imgUrl" id="imgUrl" src="${ctx }/${dataResult.photo4}" onclick="goImage(this)" />
						<img width="50px" name="imgUrl" id="imgUrl" src="${ctx }/${dataResult.photo5}" onclick="goImage(this)" />
					</td>
				</tr>
				
				<tr style="height: 20px;">
					<td colspan="3"><label for="name" class="control-label x90">商品介绍：</label>
						<textarea cols="62" rows="3" readonly >${dataResult.goodsIntroduce}</textarea>
					</td>
				</tr>
				<tr style="height: 20px;">
					<td colspan="3"><label for="name" class="control-label x90">购票须知：</label>
						<textarea cols="62" rows="3" readonly >${dataResult.buyTicketNotice}</textarea>
					</td>
				</tr>
				<tr style="height: 20px;">
					<td colspan="3"><label for="name" class="control-label x90">让利说明：</label>
						<textarea cols="62" rows="3" readonly >${dataResult.ladderPriceExplain}</textarea>
					</td>
				</tr>
				<tr style="height: 30px;">
					<td colspan="3"><label for="name" class="control-label x90">备注：</label>
						<c:if test="${flag=='edit' }">
							<textarea name="remark" id="remark"  rows="4" cols="62">${dataResult.remark}</textarea>
						</c:if>
						<c:if test="${flag=='view' }">
							<textarea name="remark" id="remark"  readonly rows="4" cols="62">${dataResult.remark}</textarea>
						</c:if>
					</td>
				</tr>
			
				<tr style="height: 30px;">
					<td colspan="3"><label for="name" class="control-label x90">商品让利信息:</label>
						 <table class="table table-bordered table-hover table-striped table-top">
					 		<thead>
								<tr>
									<td class="pass_width_ave_5_column">商户名称</td>
									<td class="pass_width_ave_5_column">票数</td>
									<td class="pass_width_ave_5_column">让利金额（百分百（%））</td>
		
								</tr>
							</thead>
							<tbody>
								<c:forEach  items="${giveProfitList}" var="giveProfit">
									<tr>
										<td class="pass_width_ave_5_column">${giveProfit.merchantName }</td>
										<td class="pass_width_ave_5_column">${giveProfit.ticketNum}</td>
										<td class="pass_width_ave_5_column">${giveProfit.giveProfitPrice }</td>
									</tr>
								</c:forEach>
							</tbody>
						 </table>
					</td>
				</tr>
				<tr style="height: 30px;"></tr>
				<tr style="height: 30px;" >
					<td colspan="3" align="center"><label for="name" class="control-label x90">散团申请信息</label>
					</td>
				</tr>
				<tr style="height: 30px;">
				<td><label for="name" class="control-label x90">散团类型:</label>
						${breakgrouprecord.breakType==1 ? '未结团散团': breakgrouprecord.breakType==2 ? '已结团散团' : '已成团散团' }
					</td>
					<td><label for="name" class="control-label x90">散团申请时间:</label>
						<fmt:formatDate value='${breakgrouprecord.applyTime}' pattern='yyyy-MM-dd HH:mm:ss'/>
					</td>
				</tr>
				<tr style="height: 30px;">
					<td colspan="3"><label for="name" class="control-label x90">散团原因:</label>
							${breakgrouprecord.breakReason }
					</td>
				</tr>
				<tr style="height: 30px;">
					<td colspan="3"><label for="name" class="control-label x90">处理意见：</label>
						<textarea name="handleOpinion" id="handleOpinion"  rows="5" cols="62"></textarea>
					</td>
				</tr>
				<tr style="height: 30px;"></tr>
			</tbody>
		</table>
	</form>
	<div style="text-align:center">
		<button class="btn-default" style="margin:10px 5px 15px 20px;" onclick="goodsBreakGroupHandle(0)" type="button" class="btn-default" data-icon="save">同意 </button>  
		<button class="btn-default"  style="margin:10px 5px 15px 20px;" onclick="goodsBreakGroupHandle(1)">不同意</button>
	</div>
</div>
<div class="bjui-pageFooter">
	<ul>
		<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
		<c:if test="${flag=='edit' }">
			<li><button type="submit" class="btn-default" data-icon="save">保存</button></li>
		</c:if>
	</ul>
</div>